function route(handle, pathname, res, request) {
    res.setHeader("Access-Control-Allow-Origin", "*");
    res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    res.setHeader("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    res.setHeader("Access-Control-Allow-Origin","*")
    // console.log("About to route a request for ", res.headers);

    let reqArry = pathname.split('/');

    handle(reqArry, res, request);
}

exports.route = route;